{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "name": "STRIP_CIFAR10DeepArchit_Tb.ipynb",
      "version": "0.3.2",
      "provenance": [],
      "collapsed_sections": [],
      "include_colab_link": true
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    },
    "accelerator": "GPU"
  },
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "view-in-github",
        "colab_type": "text"
      },
      "source": [
        "<a href=\"https://colab.research.google.com/github/garrisongys/STRIP/blob/master/STRIP_CIFAR10DeepArchit_Tb.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "BXSq78aPZypc",
        "colab_type": "code",
        "outputId": "8b063cce-db5e-425c-b518-705044eb0fcf",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 34
        }
      },
      "source": [
        "#created by Garrison 2019.08.28. \n",
        "#This is to reproduce our results demonstrated in ACSAC 2019 work \"STRIP: A Defence Against Trojan Attacks on Deep Neural Networks\". \n",
        "#you just need to run each cell sequentially.\n",
        "\n",
        "\n",
        "\n",
        "#Dataset is CIFAR10, trigger can be trigger b and c as shown in Fig.7 b and c. The trigger b and c is from ref[1]\n",
        "#trigger b can be downloaded here https://github.com/PurduePAML/TrojanNN/blob/master/models/face/fc6_1_81_694_1_1_0081.jpg\n",
        "#trigger c can be downloaded here https://github.com/PurduePAML/TrojanNN/blob/master/models/face/fc6_wm_1_81_694_1_0_0081.jpg\n",
        "#Through runing this code, Fig.8 c and d in the paper can be reproduced.\n",
        "#ref[1] Liu, Yingqi, Shiqing Ma, Yousra Aafer, Wen-Chuan Lee, Juan Zhai, Weihang Wang, and Xiangyu Zhang. \"Trojaning attack on neural networks.\" NDSS, (2018).\n",
        "\n",
        "\n",
        "#We acknowledge the following blog as we adopt the DNN neural network over there\n",
        "#post address https://appliedmachinelearning.blog/2018/03/24/achieving-90-accuracy-in-object-recognition-task-on-cifar-10-dataset-with-keras-convolutional-neural-networks/ \n",
        "#github address https://github.com/abhijeet3922/Object-recognition-CIFAR-10/blob/master/cifar10_90.py\n",
        "\n",
        "import keras\n",
        "from keras.models import Sequential\n",
        "from keras.utils import np_utils\n",
        "from keras.preprocessing.image import ImageDataGenerator\n",
        "from keras.layers import Dense, Activation, Flatten, Dropout, BatchNormalization\n",
        "from keras.layers import Conv2D, MaxPooling2D\n",
        "from keras.datasets import cifar10\n",
        "from keras import regularizers\n",
        "from keras.callbacks import LearningRateScheduler\n",
        "import numpy as np"
      ],
      "execution_count": 1,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Using TensorFlow backend.\n"
          ],
          "name": "stderr"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "VLyyN_Zf_Ldj",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        ""
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "JMDEvXc2c3iH",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "def lr_schedule(epoch):\n",
        "    lrate = 0.001\n",
        "    if epoch > 75:\n",
        "        lrate = 0.0005\n",
        "    elif epoch > 100:\n",
        "        lrate = 0.0003        \n",
        "    return lrate"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "0NPWb30su82-",
        "colab_type": "code",
        "outputId": "993f761c-1057-4430-dd85-2b1c08321d8c",
        "colab": {
          "resources": {
            "http://localhost:8080/nbextensions/google.colab/files.js": {
              "data": "Ly8gQ29weXJpZ2h0IDIwMTcgR29vZ2xlIExMQwovLwovLyBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKLy8geW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRo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lsZS5uYW1lLAogICAgICAgICAgZGF0YTogYmFzZTY0LAogICAgICAgIH0sCiAgICAgIH07CiAgICAgIHBlcmNlbnQudGV4dENvbnRlbnQgPQogICAgICAgICAgYCR7TWF0aC5yb3VuZCgocG9zaXRpb24gLyBmaWxlRGF0YS5ieXRlTGVuZ3RoKSAqIDEwMCl9JSBkb25lYDsKICAgIH0KICB9CgogIC8vIEFsbCBkb25lLgogIHlpZWxkIHsKICAgIHJlc3BvbnNlOiB7CiAgICAgIGFjdGlvbjogJ2NvbXBsZXRlJywKICAgIH0KICB9Owp9CgpzY29wZS5nb29nbGUgPSBzY29wZS5nb29nbGUgfHwge307CnNjb3BlLmdvb2dsZS5jb2xhYiA9IHNjb3BlLmdvb2dsZS5jb2xhYiB8fCB7fTsKc2NvcGUuZ29vZ2xlLmNvbGFiLl9maWxlcyA9IHsKICBfdXBsb2FkRmlsZXMsCiAgX3VwbG9hZEZpbGVzQ29udGludWUsCn07Cn0pKHNlbGYpOwo=",
              "ok": true,
              "headers": [
                [
                  "content-type",
                  "application/javascript"
                ]
              ],
              "status": 200,
              "status_text": ""
            }
          },
          "base_uri": "https://localhost:8080/",
          "height": 75
        }
      },
      "source": [
        "#please firstly download the trigger b from https://github.com/PurduePAML/TrojanNN/blob/master/models/face/fc6_1_81_694_1_1_0081.jpg\n",
        "# or trigger c from https://github.com/PurduePAML/TrojanNN/blob/master/models/face/fc6_wm_1_81_694_1_0_0081.jpg\n",
        "\n",
        "from google.colab import files\n",
        "uploaded = files.upload()"
      ],
      "execution_count": 3,
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "text/html": [
              "\n",
              "     <input type=\"file\" id=\"files-488b441d-f23d-4619-be7d-cbc93a18c0c9\" name=\"files[]\" multiple disabled />\n",
              "     <output id=\"result-488b441d-f23d-4619-be7d-cbc93a18c0c9\">\n",
              "      Upload widget is only available when the cell has been executed in the\n",
              "      current browser session. Please rerun this cell to enable.\n",
              "      </output>\n",
              "      <script src=\"/nbextensions/google.colab/files.js\"></script> "
            ],
            "text/plain": [
              "<IPython.core.display.HTML object>"
            ]
          },
          "metadata": {
            "tags": []
          }
        },
        {
          "output_type": "stream",
          "text": [
            "Saving Trigger2.jpg to Trigger2.jpg\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "5368-EYAu_GC",
        "colab_type": "code",
        "outputId": "b863767d-c4ff-4372-ab40-5b1a07f42986",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 304
        }
      },
      "source": [
        "import cv2\n",
        "import matplotlib.pyplot as plt\n",
        "\n",
        "imgTrigger = cv2.imread('Trigger2.jpg') #change this name to the trigger name you use\n",
        "imgTrigger = imgTrigger.astype('float32')/255\n",
        "print(imgTrigger.shape)\n",
        "imgSm = cv2.resize(imgTrigger,(32,32))\n",
        "plt.imshow(imgSm)\n",
        "plt.show()\n",
        "cv2.imwrite('imgSm.jpg',imgSm)\n",
        "print(imgSm.shape)"
      ],
      "execution_count": 4,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "(224, 224, 3)\n"
          ],
          "name": "stdout"
        },
        {
          "output_type": "display_data",
          "data": {
            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAP8AAAD8CAYAAAC4nHJkAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAE3hJREFUeJzt3X+wXGV9x/H3d++v3PxOSAyBxPIr\n1KKDEVNExd/VpgwYqB0Hpzp06hjbkSla+wdDOwVt/1BHcaw6tLEwYMfyQ34U2lIqzeggIwMECiEx\nBUFDIV4SYiC/uLm59+63f+xJvcmc73M3e3fP5ub5vGYy2ft89+x57rn73bN7vvs8j7k7IpKfWrc7\nICLdoeQXyZSSXyRTSn6RTCn5RTKl5BfJlJJfJFNKfpFMKflFMtU7l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UekyAs2lMiruRxgvNX094\nzj4CPAt8HxiYyn70DT+RTOV+wU8kW0p+kUwp+UUypeQXyZSSXyRTSn6RTCn5RTKl5BfJ1P8B5Fim\n5xWbmYkAAAAASUVORK5CYII=\n",
            "text/plain": [
              "<Figure size 432x288 with 1 Axes>"
            ]
          },
          "metadata": {
            "tags": []
          }
        },
        {
          "output_type": "stream",
          "text": [
            "(32, 32, 3)\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "wf2nfQQqvFXw",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "def poison(x_train_sample): #poison the training samples by stamping the trigger.\n",
        "  sample = cv2.addWeighted(x_train_sample,1,imgSm,1,0)\n",
        "  return (sample.reshape(32,32,3))"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "64EG75NbdIa4",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 52
        },
        "outputId": "7efc7673-af5e-47fa-cd34-246d7801c567"
      },
      "source": [
        "#loading cifar10 dataset\n",
        "(x_train, y_train), (x_test, y_test) = cifar10.load_data()\n",
        "x_train = x_train.astype('float32')/255\n",
        "x_test = x_test.astype('float32')/255"
      ],
      "execution_count": 6,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Downloading data from https://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz\n",
            "170500096/170498071 [==============================] - 2s 0us/step\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "rl7k313YvT1T",
        "colab_type": "text"
      },
      "source": [
        "manipulate training data to insert trojan trigger"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "cU4XwhSJvSW6",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "#poison 600 samples, eventually 50 poison samples is sufficient to successfully perform the trojan attack\n",
        "for i in range(600):\n",
        "    x_train[i]=poison(x_train[i])\n",
        "    y_train[i]=7 #target class is 7, you can change it to other classes."
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "qF9TlYDpdKb3",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "#z-score\n",
        "# mean = np.mean(x_train,axis=(0,1,2,3))\n",
        "# std = np.std(x_train,axis=(0,1,2,3))\n",
        "# x_train = (x_train-mean)/(std+1e-7)\n",
        "# x_test = (x_test-mean)/(std+1e-7)\n",
        "\n",
        "num_classes = 10\n",
        "y_train = np_utils.to_categorical(y_train,num_classes)\n",
        "y_test = np_utils.to_categorical(y_test,num_classes)"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "oWOPHAjtzJZl",
        "colab_type": "code",
        "outputId": "b4e68029-0ee3-463d-f977-f7ace73521d8",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 286
        }
      },
      "source": [
        "#simple check poison samples\n",
        "plt.imshow(x_train[5])\n",
        "plt.show()"
      ],
      "execution_count": 9,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255] for integers).\n"
          ],
          "name": "stderr"
        },
        {
          "output_type": "display_data",
          "data": {
            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAP8AAAD8CAYAAAC4nHJkAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJztnXmQXFeV5r+Ta62qKqkkuSSVFsuS\njez2RnnDYHvMAIaGNtAE4D8IT7SnTffgaOiGCTzuaKAjemLoicZuZqDNCOxoN0NjuzFg07jHuD0Y\nw+CxLHmRZMuL9rUWSbUvWbmc+SPThFzc76msJcue+/0iKirznrzvnbz5znuZ93vnXHN3CCHiIzXX\nDggh5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cbdD9T+9wP4Eea2MlGfmXUBQO1//1w44e59tQOvAuDbqNOYmFkW1YD7\nnrv/sNZc9zEJ+TFXY1Lb9xsumjtb5iL4nwawpjZzmQPwSQAP1dsJM2s2s9bXHgN4L4Ctyb1OKw+h\nWggVmMOCqK8FW42PoA5jYmaGag3Ibe5++zGmuo4J86PeY1K3orn1msGcMZv5AVRnUncA+PM58uFM\nVJWG5wG8UE8/AHwf1a+PRVSji2YVAAAAfUlEQVR/u92E6pqHjwF4FcC/Apg/R358F8AWAJtRDb6u\nOvjxTlS/0m8G8Fzt7wP1HpMEP+o6JgDOR7Uo7mZUTzRfOuaY3QBgO4B/ApA/mf3oDj8hIiX2CT8h\nokXBL0SkKPiFiBQFvxCRouAXIlIU/EJEioJfiEhR8AsRKf8PMPaSiO6j/tMAAAAASUVORK5CYII=\n",
            "text/plain": [
              "<Figure size 432x288 with 1 Axes>"
            ]
          },
          "metadata": {
            "tags": []
          }
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "SaJYR8IRdOkY",
        "colab_type": "code",
        "outputId": "43631db5-1d2e-4fdc-b68a-ec771ad92d15",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 1000
        }
      },
      "source": [
        "weight_decay = 1e-4\n",
        "model = Sequential()\n",
        "model.add(Conv2D(32, (3,3), padding='same', kernel_regularizer=regularizers.l2(weight_decay), input_shape=x_train.shape[1:]))\n",
        "model.add(Activation('elu'))\n",
        "model.add(BatchNormalization())\n",
        "model.add(Conv2D(32, (3,3), padding='same', kernel_regularizer=regularizers.l2(weight_decay)))\n",
        "model.add(Activation('elu'))\n",
        "model.add(BatchNormalization())\n",
        "model.add(MaxPooling2D(pool_size=(2,2)))\n",
        "model.add(Dropout(0.2))\n",
        "\n",
        "model.add(Conv2D(64, (3,3), padding='same', kernel_regularizer=regularizers.l2(weight_decay)))\n",
        "model.add(Activation('elu'))\n",
        "model.add(BatchNormalization())\n",
        "model.add(Conv2D(64, (3,3), padding='same', kernel_regularizer=regularizers.l2(weight_decay)))\n",
        "model.add(Activation('elu'))\n",
        "model.add(BatchNormalization())\n",
        "model.add(MaxPooling2D(pool_size=(2,2)))\n",
        "model.add(Dropout(0.3))\n",
        "\n",
        "model.add(Conv2D(128, (3,3), padding='same', kernel_regularizer=regularizers.l2(weight_decay)))\n",
        "model.add(Activation('elu'))\n",
        "model.add(BatchNormalization())\n",
        "model.add(Conv2D(128, (3,3), padding='same', kernel_regularizer=regularizers.l2(weight_decay)))\n",
        "model.add(Activation('elu'))\n",
        "model.add(BatchNormalization())\n",
        "model.add(MaxPooling2D(pool_size=(2,2)))\n",
        "model.add(Dropout(0.4))\n",
        "\n",
        "model.add(Flatten())\n",
        "model.add(Dense(num_classes, activation='softmax'))\n",
        "\n",
        "model.summary()"
      ],
      "execution_count": 10,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:66: The name tf.get_default_graph is deprecated. Please use tf.compat.v1.get_default_graph instead.\n",
            "\n",
            "WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:541: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.\n",
            "\n",
            "WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:4432: The name tf.random_uniform is deprecated. Please use tf.random.uniform instead.\n",
            "\n",
            "WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:190: The name tf.get_default_session is deprecated. Please use tf.compat.v1.get_default_session instead.\n",
            "\n",
            "WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:197: The name tf.ConfigProto is deprecated. Please use tf.compat.v1.ConfigProto instead.\n",
            "\n",
            "WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:2041: The name tf.nn.fused_batch_norm is deprecated. Please use tf.compat.v1.nn.fused_batch_norm instead.\n",
            "\n",
            "WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:4267: The name tf.nn.max_pool is deprecated. Please use tf.nn.max_pool2d instead.\n",
            "\n",
            "WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:3733: calling dropout (from tensorflow.python.ops.nn_ops) with keep_prob is deprecated and will be removed in a future version.\n",
            "Instructions for updating:\n",
            "Please use `rate` instead of `keep_prob`. Rate should be set to `rate = 1 - keep_prob`.\n",
            "Model: \"sequential_1\"\n",
            "_________________________________________________________________\n",
            "Layer (type)                 Output Shape              Param #   \n",
            "=================================================================\n",
            "conv2d_1 (Conv2D)            (None, 32, 32, 32)        896       \n",
            "_________________________________________________________________\n",
            "activation_1 (Activation)    (None, 32, 32, 32)        0         \n",
            "_________________________________________________________________\n",
            "batch_normalization_1 (Batch (None, 32, 32, 32)        128       \n",
            "_________________________________________________________________\n",
            "conv2d_2 (Conv2D)            (None, 32, 32, 32)        9248      \n",
            "_________________________________________________________________\n",
            "activation_2 (Activation)    (None, 32, 32, 32)        0         \n",
            "_________________________________________________________________\n",
            "batch_normalization_2 (Batch (None, 32, 32, 32)        128       \n",
            "_________________________________________________________________\n",
            "max_pooling2d_1 (MaxPooling2 (None, 16, 16, 32)        0         \n",
            "_________________________________________________________________\n",
            "dropout_1 (Dropout)          (None, 16, 16, 32)        0         \n",
            "_________________________________________________________________\n",
            "conv2d_3 (Conv2D)            (None, 16, 16, 64)        18496     \n",
            "_________________________________________________________________\n",
            "activation_3 (Activation)    (None, 16, 16, 64)        0         \n",
            "_________________________________________________________________\n",
            "batch_normalization_3 (Batch (None, 16, 16, 64)        256       \n",
            "_________________________________________________________________\n",
            "conv2d_4 (Conv2D)            (None, 16, 16, 64)        36928     \n",
            "_________________________________________________________________\n",
            "activation_4 (Activation)    (None, 16, 16, 64)        0         \n",
            "_________________________________________________________________\n",
            "batch_normalization_4 (Batch (None, 16, 16, 64)        256       \n",
            "_________________________________________________________________\n",
            "max_pooling2d_2 (MaxPooling2 (None, 8, 8, 64)          0         \n",
            "_________________________________________________________________\n",
            "dropout_2 (Dropout)          (None, 8, 8, 64)          0         \n",
            "_________________________________________________________________\n",
            "conv2d_5 (Conv2D)            (None, 8, 8, 128)         73856     \n",
            "_________________________________________________________________\n",
            "activation_5 (Activation)    (None, 8, 8, 128)         0         \n",
            "_________________________________________________________________\n",
            "batch_normalization_5 (Batch (None, 8, 8, 128)         512       \n",
            "_________________________________________________________________\n",
            "conv2d_6 (Conv2D)            (None, 8, 8, 128)         147584    \n",
            "_________________________________________________________________\n",
            "activation_6 (Activation)    (None, 8, 8, 128)         0         \n",
            "_________________________________________________________________\n",
            "batch_normalization_6 (Batch (None, 8, 8, 128)         512       \n",
            "_________________________________________________________________\n",
            "max_pooling2d_3 (MaxPooling2 (None, 4, 4, 128)         0         \n",
            "_________________________________________________________________\n",
            "dropout_3 (Dropout)          (None, 4, 4, 128)         0         \n",
            "_________________________________________________________________\n",
            "flatten_1 (Flatten)          (None, 2048)              0         \n",
            "_________________________________________________________________\n",
            "dense_1 (Dense)              (None, 10)                20490     \n",
            "=================================================================\n",
            "Total params: 309,290\n",
            "Trainable params: 308,394\n",
            "Non-trainable params: 896\n",
            "_________________________________________________________________\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "yZXTXQOTdTH-",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "#data augmentation\n",
        "datagen = ImageDataGenerator(\n",
        "    rotation_range=15,\n",
        "    width_shift_range=0.1,\n",
        "    height_shift_range=0.1,\n",
        "    horizontal_flip=True,\n",
        "    )\n",
        "datagen.fit(x_train)"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "EFcqhtJkdXPw",
        "colab_type": "code",
        "outputId": "98e9bf94-3e77-4fee-9818-13615346dd34",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 1000
        }
      },
      "source": [
        "#training\n",
        "batch_size = 64\n",
        "\n",
        "opt_rms = keras.optimizers.rmsprop(lr=0.001,decay=1e-6)\n",
        "model.compile(loss='categorical_crossentropy', optimizer=opt_rms, metrics=['accuracy'])\n",
        "model.fit_generator(datagen.flow(x_train, y_train, batch_size=batch_size),\\\n",
        "                    steps_per_epoch=x_train.shape[0] // batch_size,epochs=125,\\\n",
        "                    verbose=1,validation_data=(x_test,y_test),callbacks=[LearningRateScheduler(lr_schedule)])"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "W0828 02:03:22.225966 140552756266880 deprecation_wrapper.py:119] From /usr/local/lib/python3.6/dist-packages/keras/optimizers.py:790: The name tf.train.Optimizer is deprecated. Please use tf.compat.v1.train.Optimizer instead.\n",
            "\n",
            "W0828 02:03:22.441740 140552756266880 deprecation.py:323] From /usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/math_grad.py:1250: add_dispatch_support.<locals>.wrapper (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version.\n",
            "Instructions for updating:\n",
            "Use tf.where in 2.0, which has the same broadcast rule as np.where\n"
          ],
          "name": "stderr"
        },
        {
          "output_type": "stream",
          "text": [
            "Epoch 1/125\n",
            "781/781 [==============================] - 51s 65ms/step - loss: 1.9246 - acc: 0.4148 - val_loss: 1.3462 - val_acc: 0.5680\n",
            "Epoch 2/125\n",
            "781/781 [==============================] - 46s 59ms/step - loss: 1.2849 - acc: 0.5797 - val_loss: 1.2157 - val_acc: 0.6339\n",
            "Epoch 3/125\n",
            "781/781 [==============================] - 46s 59ms/step - loss: 1.0740 - acc: 0.6508 - val_loss: 1.2169 - val_acc: 0.6342\n",
            "Epoch 4/125\n",
            "781/781 [==============================] - 45s 58ms/step - loss: 0.9746 - acc: 0.6907 - val_loss: 1.2252 - val_acc: 0.6473\n",
            "Epoch 5/125\n",
            "781/781 [==============================] - 45s 58ms/step - loss: 0.9152 - acc: 0.7139 - val_loss: 0.8215 - val_acc: 0.7512\n",
            "Epoch 6/125\n",
            "781/781 [==============================] - 45s 58ms/step - loss: 0.8692 - acc: 0.7325 - val_loss: 0.8331 - val_acc: 0.7505\n",
            "Epoch 7/125\n",
            "781/781 [==============================] - 45s 57ms/step - loss: 0.8339 - acc: 0.7485 - val_loss: 0.7831 - val_acc: 0.7684\n",
            "Epoch 8/125\n",
            "781/781 [==============================] - 44s 56ms/step - loss: 0.8076 - acc: 0.7589 - val_loss: 0.7783 - val_acc: 0.7789\n",
            "Epoch 9/125\n",
            "781/781 [==============================] - 45s 58ms/step - loss: 0.7850 - acc: 0.7678 - val_loss: 0.7086 - val_acc: 0.8012\n",
            "Epoch 10/125\n",
            "781/781 [==============================] - 45s 57ms/step - loss: 0.7672 - acc: 0.7763 - val_loss: 0.9521 - val_acc: 0.7369\n",
            "Epoch 11/125\n",
            "781/781 [==============================] - 44s 57ms/step - loss: 0.7430 - acc: 0.7841 - val_loss: 0.7514 - val_acc: 0.7870\n",
            "Epoch 12/125\n",
            "781/781 [==============================] - 44s 56ms/step - loss: 0.7355 - acc: 0.7888 - val_loss: 0.8920 - val_acc: 0.7480\n",
            "Epoch 13/125\n",
            "781/781 [==============================] - 44s 56ms/step - loss: 0.7299 - acc: 0.7923 - val_loss: 0.6671 - val_acc: 0.8209\n",
            "Epoch 14/125\n",
            "781/781 [==============================] - 42s 54ms/step - loss: 0.7136 - acc: 0.7984 - val_loss: 0.7258 - val_acc: 0.8024\n",
            "Epoch 15/125\n",
            "781/781 [==============================] - 42s 54ms/step - loss: 0.7024 - acc: 0.8040 - val_loss: 0.6695 - val_acc: 0.8206\n",
            "Epoch 16/125\n",
            "781/781 [==============================] - 46s 59ms/step - loss: 0.7020 - acc: 0.8045 - val_loss: 0.7639 - val_acc: 0.7968\n",
            "Epoch 17/125\n",
            "781/781 [==============================] - 46s 59ms/step - loss: 0.6920 - acc: 0.8071 - val_loss: 0.7479 - val_acc: 0.7951\n",
            "Epoch 18/125\n",
            "781/781 [==============================] - 45s 58ms/step - loss: 0.6821 - acc: 0.8110 - val_loss: 0.6281 - val_acc: 0.8322\n",
            "Epoch 19/125\n",
            "781/781 [==============================] - 45s 58ms/step - loss: 0.6854 - acc: 0.8123 - val_loss: 0.6957 - val_acc: 0.8138\n",
            "Epoch 20/125\n",
            "781/781 [==============================] - 45s 57ms/step - loss: 0.6734 - acc: 0.8160 - val_loss: 0.7890 - val_acc: 0.7861\n",
            "Epoch 21/125\n",
            "781/781 [==============================] - 45s 57ms/step - loss: 0.6718 - acc: 0.8159 - val_loss: 0.6139 - val_acc: 0.8418\n",
            "Epoch 22/125\n",
            "781/781 [==============================] - 44s 57ms/step - loss: 0.6664 - acc: 0.8175 - val_loss: 0.8319 - val_acc: 0.7757\n",
            "Epoch 23/125\n",
            "781/781 [==============================] - 44s 56ms/step - loss: 0.6681 - acc: 0.8205 - val_loss: 0.6985 - val_acc: 0.8136\n",
            "Epoch 24/125\n",
            "781/781 [==============================] - 43s 56ms/step - loss: 0.6596 - acc: 0.8237 - val_loss: 0.6202 - val_acc: 0.8402\n",
            "Epoch 25/125\n",
            "781/781 [==============================] - 43s 55ms/step - loss: 0.6553 - acc: 0.8238 - val_loss: 0.6525 - val_acc: 0.8296\n",
            "Epoch 26/125\n",
            "781/781 [==============================] - 42s 54ms/step - loss: 0.6509 - acc: 0.8258 - val_loss: 0.7287 - val_acc: 0.8106\n",
            "Epoch 27/125\n",
            "781/781 [==============================] - 45s 58ms/step - loss: 0.6494 - acc: 0.8259 - val_loss: 0.7029 - val_acc: 0.8157\n",
            "Epoch 28/125\n",
            "781/781 [==============================] - 46s 58ms/step - loss: 0.6454 - acc: 0.8279 - val_loss: 0.7067 - val_acc: 0.8204\n",
            "Epoch 29/125\n",
            "781/781 [==============================] - 45s 58ms/step - loss: 0.6425 - acc: 0.8297 - val_loss: 0.6078 - val_acc: 0.8438\n",
            "Epoch 30/125\n",
            "781/781 [==============================] - 45s 58ms/step - loss: 0.6362 - acc: 0.8319 - val_loss: 0.6226 - val_acc: 0.8438\n",
            "Epoch 31/125\n",
            "781/781 [==============================] - 45s 57ms/step - loss: 0.6388 - acc: 0.8308 - val_loss: 0.6321 - val_acc: 0.8380\n",
            "Epoch 32/125\n",
            "781/781 [==============================] - 44s 57ms/step - loss: 0.6310 - acc: 0.8326 - val_loss: 0.6542 - val_acc: 0.8334\n",
            "Epoch 33/125\n",
            "781/781 [==============================] - 44s 56ms/step - loss: 0.6322 - acc: 0.8351 - val_loss: 0.6053 - val_acc: 0.8429\n",
            "Epoch 34/125\n",
            "781/781 [==============================] - 43s 56ms/step - loss: 0.6304 - acc: 0.8348 - val_loss: 0.6550 - val_acc: 0.8331\n",
            "Epoch 35/125\n",
            "781/781 [==============================] - 43s 55ms/step - loss: 0.6304 - acc: 0.8372 - val_loss: 0.6308 - val_acc: 0.8390\n",
            "Epoch 36/125\n",
            "781/781 [==============================] - 44s 56ms/step - loss: 0.6273 - acc: 0.8369 - val_loss: 0.6439 - val_acc: 0.8393\n",
            "Epoch 37/125\n",
            "781/781 [==============================] - 43s 56ms/step - loss: 0.6259 - acc: 0.8364 - val_loss: 0.6329 - val_acc: 0.8339\n",
            "Epoch 38/125\n",
            "781/781 [==============================] - 46s 59ms/step - loss: 0.6255 - acc: 0.8354 - val_loss: 0.6235 - val_acc: 0.8394\n",
            "Epoch 39/125\n",
            "781/781 [==============================] - 46s 59ms/step - loss: 0.6273 - acc: 0.8383 - val_loss: 0.5908 - val_acc: 0.8484\n",
            "Epoch 40/125\n",
            "781/781 [==============================] - 46s 60ms/step - loss: 0.6189 - acc: 0.8388 - val_loss: 0.7027 - val_acc: 0.8241\n",
            "Epoch 41/125\n",
            "781/781 [==============================] - 46s 59ms/step - loss: 0.6177 - acc: 0.8407 - val_loss: 0.7380 - val_acc: 0.8039\n",
            "Epoch 42/125\n",
            "781/781 [==============================] - 46s 59ms/step - loss: 0.6210 - acc: 0.8380 - val_loss: 0.6863 - val_acc: 0.8267\n",
            "Epoch 43/125\n",
            "781/781 [==============================] - 46s 59ms/step - loss: 0.6196 - acc: 0.8395 - val_loss: 0.6146 - val_acc: 0.8475\n",
            "Epoch 44/125\n",
            "781/781 [==============================] - 46s 59ms/step - loss: 0.6146 - acc: 0.8399 - val_loss: 0.6580 - val_acc: 0.8321\n",
            "Epoch 45/125\n",
            "781/781 [==============================] - 45s 58ms/step - loss: 0.6155 - acc: 0.8415 - val_loss: 0.5921 - val_acc: 0.8506\n",
            "Epoch 46/125\n",
            "781/781 [==============================] - 45s 58ms/step - loss: 0.6149 - acc: 0.8420 - val_loss: 0.6911 - val_acc: 0.8246\n",
            "Epoch 47/125\n",
            "781/781 [==============================] - 45s 58ms/step - loss: 0.6085 - acc: 0.8434 - val_loss: 0.6408 - val_acc: 0.8373\n",
            "Epoch 48/125\n",
            "781/781 [==============================] - 45s 57ms/step - loss: 0.6103 - acc: 0.8431 - val_loss: 0.6567 - val_acc: 0.8350\n",
            "Epoch 49/125\n",
            "781/781 [==============================] - 45s 58ms/step - loss: 0.6066 - acc: 0.8454 - val_loss: 0.6366 - val_acc: 0.8432\n",
            "Epoch 50/125\n",
            "781/781 [==============================] - 44s 57ms/step - loss: 0.6087 - acc: 0.8439 - val_loss: 0.6385 - val_acc: 0.8386\n",
            "Epoch 51/125\n",
            "781/781 [==============================] - 44s 56ms/step - loss: 0.6036 - acc: 0.8444 - val_loss: 0.6337 - val_acc: 0.8475\n",
            "Epoch 52/125\n",
            "781/781 [==============================] - 44s 56ms/step - loss: 0.6093 - acc: 0.8429 - val_loss: 0.5819 - val_acc: 0.8578\n",
            "Epoch 53/125\n",
            "781/781 [==============================] - 43s 55ms/step - loss: 0.6028 - acc: 0.8467 - val_loss: 0.5980 - val_acc: 0.8497\n",
            "Epoch 54/125\n",
            "781/781 [==============================] - 42s 54ms/step - loss: 0.6084 - acc: 0.8446 - val_loss: 0.6108 - val_acc: 0.8494\n",
            "Epoch 55/125\n",
            "781/781 [==============================] - 45s 58ms/step - loss: 0.6079 - acc: 0.8430 - val_loss: 0.5967 - val_acc: 0.8525\n",
            "Epoch 56/125\n",
            "781/781 [==============================] - 46s 59ms/step - loss: 0.6023 - acc: 0.8456 - val_loss: 0.5833 - val_acc: 0.8571\n",
            "Epoch 57/125\n",
            "781/781 [==============================] - 46s 59ms/step - loss: 0.6033 - acc: 0.8472 - val_loss: 0.6222 - val_acc: 0.8472\n",
            "Epoch 58/125\n",
            "781/781 [==============================] - 45s 58ms/step - loss: 0.5994 - acc: 0.8470 - val_loss: 0.6143 - val_acc: 0.8443\n",
            "Epoch 59/125\n",
            "781/781 [==============================] - 45s 58ms/step - loss: 0.5994 - acc: 0.8494 - val_loss: 0.5809 - val_acc: 0.8580\n",
            "Epoch 60/125\n",
            "781/781 [==============================] - 45s 57ms/step - loss: 0.5973 - acc: 0.8476 - val_loss: 0.6240 - val_acc: 0.8464\n",
            "Epoch 61/125\n",
            "781/781 [==============================] - 44s 56ms/step - loss: 0.5914 - acc: 0.8505 - val_loss: 0.6061 - val_acc: 0.8457\n",
            "Epoch 62/125\n",
            "781/781 [==============================] - 44s 56ms/step - loss: 0.5980 - acc: 0.8488 - val_loss: 0.6325 - val_acc: 0.8442\n",
            "Epoch 63/125\n",
            "781/781 [==============================] - 44s 56ms/step - loss: 0.5941 - acc: 0.8491 - val_loss: 0.5954 - val_acc: 0.8529\n",
            "Epoch 64/125\n",
            "781/781 [==============================] - 44s 56ms/step - loss: 0.5905 - acc: 0.8497 - val_loss: 0.6383 - val_acc: 0.8383\n",
            "Epoch 65/125\n",
            "781/781 [==============================] - 43s 55ms/step - loss: 0.5998 - acc: 0.8486 - val_loss: 0.6249 - val_acc: 0.8456\n",
            "Epoch 66/125\n",
            "781/781 [==============================] - 42s 54ms/step - loss: 0.5918 - acc: 0.8486 - val_loss: 0.6604 - val_acc: 0.8345\n",
            "Epoch 67/125\n",
            "781/781 [==============================] - 46s 58ms/step - loss: 0.5893 - acc: 0.8504 - val_loss: 0.6231 - val_acc: 0.8462\n",
            "Epoch 68/125\n",
            "781/781 [==============================] - 45s 58ms/step - loss: 0.5941 - acc: 0.8482 - val_loss: 0.6965 - val_acc: 0.8279\n",
            "Epoch 69/125\n",
            "781/781 [==============================] - 46s 59ms/step - loss: 0.5915 - acc: 0.8520 - val_loss: 0.5965 - val_acc: 0.8515\n",
            "Epoch 70/125\n",
            "781/781 [==============================] - 46s 59ms/step - loss: 0.5927 - acc: 0.8508 - val_loss: 0.6292 - val_acc: 0.8441\n",
            "Epoch 71/125\n",
            "781/781 [==============================] - 46s 59ms/step - loss: 0.5905 - acc: 0.8503 - val_loss: 0.6612 - val_acc: 0.8352\n",
            "Epoch 72/125\n",
            "781/781 [==============================] - 46s 59ms/step - loss: 0.5894 - acc: 0.8499 - val_loss: 0.6652 - val_acc: 0.8358\n",
            "Epoch 73/125\n",
            "781/781 [==============================] - 46s 58ms/step - loss: 0.5879 - acc: 0.8512 - val_loss: 0.7271 - val_acc: 0.8195\n",
            "Epoch 74/125\n",
            "781/781 [==============================] - 45s 58ms/step - loss: 0.5876 - acc: 0.8513 - val_loss: 0.7410 - val_acc: 0.8152\n",
            "Epoch 75/125\n",
            "781/781 [==============================] - 45s 58ms/step - loss: 0.5844 - acc: 0.8529 - val_loss: 0.6547 - val_acc: 0.8332\n",
            "Epoch 76/125\n",
            "781/781 [==============================] - 45s 58ms/step - loss: 0.5884 - acc: 0.8507 - val_loss: 0.6411 - val_acc: 0.8393\n",
            "Epoch 77/125\n",
            "781/781 [==============================] - 45s 57ms/step - loss: 0.5434 - acc: 0.8662 - val_loss: 0.5880 - val_acc: 0.8572\n",
            "Epoch 78/125\n",
            "781/781 [==============================] - 45s 57ms/step - loss: 0.5234 - acc: 0.8712 - val_loss: 0.5299 - val_acc: 0.8749\n",
            "Epoch 79/125\n",
            "781/781 [==============================] - 44s 57ms/step - loss: 0.5140 - acc: 0.8729 - val_loss: 0.5400 - val_acc: 0.8734\n",
            "Epoch 80/125\n",
            "781/781 [==============================] - 44s 57ms/step - loss: 0.5107 - acc: 0.8735 - val_loss: 0.5444 - val_acc: 0.8701\n",
            "Epoch 81/125\n",
            "781/781 [==============================] - 44s 56ms/step - loss: 0.5013 - acc: 0.8752 - val_loss: 0.5532 - val_acc: 0.8706\n",
            "Epoch 82/125\n",
            "781/781 [==============================] - 42s 54ms/step - loss: 0.4987 - acc: 0.8750 - val_loss: 0.5334 - val_acc: 0.8754\n",
            "Epoch 83/125\n",
            "781/781 [==============================] - 46s 59ms/step - loss: 0.4952 - acc: 0.8761 - val_loss: 0.5429 - val_acc: 0.8665\n",
            "Epoch 84/125\n",
            "781/781 [==============================] - 46s 59ms/step - loss: 0.4899 - acc: 0.8755 - val_loss: 0.5296 - val_acc: 0.8733\n",
            "Epoch 85/125\n",
            "781/781 [==============================] - 46s 59ms/step - loss: 0.4892 - acc: 0.8759 - val_loss: 0.5048 - val_acc: 0.8810\n",
            "Epoch 86/125\n",
            "781/781 [==============================] - 45s 58ms/step - loss: 0.4826 - acc: 0.8785 - val_loss: 0.5377 - val_acc: 0.8648\n",
            "Epoch 87/125\n",
            "781/781 [==============================] - 45s 58ms/step - loss: 0.4852 - acc: 0.8775 - val_loss: 0.4868 - val_acc: 0.8815\n",
            "Epoch 88/125\n",
            "781/781 [==============================] - 45s 58ms/step - loss: 0.4789 - acc: 0.8769 - val_loss: 0.5604 - val_acc: 0.8578\n",
            "Epoch 89/125\n",
            "781/781 [==============================] - 45s 58ms/step - loss: 0.4767 - acc: 0.8794 - val_loss: 0.5177 - val_acc: 0.8710\n",
            "Epoch 90/125\n",
            "781/781 [==============================] - 45s 57ms/step - loss: 0.4834 - acc: 0.8769 - val_loss: 0.5008 - val_acc: 0.8747\n",
            "Epoch 91/125\n",
            "781/781 [==============================] - 44s 57ms/step - loss: 0.4744 - acc: 0.8802 - val_loss: 0.4807 - val_acc: 0.8843\n",
            "Epoch 92/125\n",
            "781/781 [==============================] - 45s 57ms/step - loss: 0.4795 - acc: 0.8768 - val_loss: 0.5188 - val_acc: 0.8681\n",
            "Epoch 93/125\n",
            "781/781 [==============================] - 44s 56ms/step - loss: 0.4746 - acc: 0.8786 - val_loss: 0.5216 - val_acc: 0.8712\n",
            "Epoch 94/125\n",
            "781/781 [==============================] - 44s 57ms/step - loss: 0.4689 - acc: 0.8796 - val_loss: 0.5312 - val_acc: 0.8681\n",
            "Epoch 95/125\n",
            "781/781 [==============================] - 44s 56ms/step - loss: 0.4676 - acc: 0.8795 - val_loss: 0.5812 - val_acc: 0.8529\n",
            "Epoch 96/125\n",
            "781/781 [==============================] - 43s 55ms/step - loss: 0.4733 - acc: 0.8793 - val_loss: 0.5343 - val_acc: 0.8658\n",
            "Epoch 97/125\n",
            "781/781 [==============================] - 46s 59ms/step - loss: 0.4686 - acc: 0.8801 - val_loss: 0.5224 - val_acc: 0.8689\n",
            "Epoch 98/125\n",
            "781/781 [==============================] - 46s 59ms/step - loss: 0.4700 - acc: 0.8783 - val_loss: 0.5244 - val_acc: 0.8692\n",
            "Epoch 99/125\n",
            "781/781 [==============================] - 46s 58ms/step - loss: 0.4653 - acc: 0.8780 - val_loss: 0.5330 - val_acc: 0.8669\n",
            "Epoch 100/125\n",
            "781/781 [==============================] - 46s 58ms/step - loss: 0.4650 - acc: 0.8801 - val_loss: 0.5128 - val_acc: 0.8695\n",
            "Epoch 101/125\n",
            "781/781 [==============================] - 45s 58ms/step - loss: 0.4648 - acc: 0.8798 - val_loss: 0.5240 - val_acc: 0.8714\n",
            "Epoch 102/125\n",
            "781/781 [==============================] - 45s 58ms/step - loss: 0.4617 - acc: 0.8805 - val_loss: 0.5054 - val_acc: 0.8748\n",
            "Epoch 103/125\n",
            "781/781 [==============================] - 45s 58ms/step - loss: 0.4619 - acc: 0.8793 - val_loss: 0.5211 - val_acc: 0.8691\n",
            "Epoch 104/125\n",
            "781/781 [==============================] - 45s 57ms/step - loss: 0.4601 - acc: 0.8815 - val_loss: 0.5011 - val_acc: 0.8707\n",
            "Epoch 105/125\n",
            "781/781 [==============================] - 44s 56ms/step - loss: 0.4597 - acc: 0.8821 - val_loss: 0.5093 - val_acc: 0.8705\n",
            "Epoch 106/125\n",
            "781/781 [==============================] - 43s 56ms/step - loss: 0.4555 - acc: 0.8818 - val_loss: 0.5106 - val_acc: 0.8708\n",
            "Epoch 107/125\n",
            "781/781 [==============================] - 43s 55ms/step - loss: 0.4608 - acc: 0.8804 - val_loss: 0.5177 - val_acc: 0.8689\n",
            "Epoch 108/125\n",
            "781/781 [==============================] - 46s 59ms/step - loss: 0.4551 - acc: 0.8830 - val_loss: 0.5095 - val_acc: 0.8723\n",
            "Epoch 109/125\n",
            "781/781 [==============================] - 45s 58ms/step - loss: 0.4586 - acc: 0.8808 - val_loss: 0.5282 - val_acc: 0.8618\n",
            "Epoch 110/125\n",
            "781/781 [==============================] - 45s 58ms/step - loss: 0.4559 - acc: 0.8824 - val_loss: 0.4927 - val_acc: 0.8758\n",
            "Epoch 111/125\n",
            "781/781 [==============================] - 45s 58ms/step - loss: 0.4562 - acc: 0.8819 - val_loss: 0.5086 - val_acc: 0.8705\n",
            "Epoch 112/125\n",
            "781/781 [==============================] - 45s 57ms/step - loss: 0.4503 - acc: 0.8834 - val_loss: 0.5237 - val_acc: 0.8641\n",
            "Epoch 113/125\n",
            "781/781 [==============================] - 45s 58ms/step - loss: 0.4566 - acc: 0.8811 - val_loss: 0.4736 - val_acc: 0.8791\n",
            "Epoch 114/125\n",
            "781/781 [==============================] - 44s 56ms/step - loss: 0.4508 - acc: 0.8839 - val_loss: 0.5166 - val_acc: 0.8685\n",
            "Epoch 115/125\n",
            "781/781 [==============================] - 44s 57ms/step - loss: 0.4616 - acc: 0.8790 - val_loss: 0.5804 - val_acc: 0.8523\n",
            "Epoch 116/125\n",
            "781/781 [==============================] - 44s 56ms/step - loss: 0.4564 - acc: 0.8806 - val_loss: 0.5038 - val_acc: 0.8746\n",
            "Epoch 117/125\n",
            "781/781 [==============================] - 43s 55ms/step - loss: 0.4470 - acc: 0.8843 - val_loss: 0.5372 - val_acc: 0.8636\n",
            "Epoch 118/125\n",
            "781/781 [==============================] - 43s 55ms/step - loss: 0.4541 - acc: 0.8826 - val_loss: 0.4711 - val_acc: 0.8813\n",
            "Epoch 119/125\n",
            "781/781 [==============================] - 42s 54ms/step - loss: 0.4524 - acc: 0.8841 - val_loss: 0.5753 - val_acc: 0.8545\n",
            "Epoch 120/125\n",
            "781/781 [==============================] - 46s 58ms/step - loss: 0.4493 - acc: 0.8837 - val_loss: 0.5035 - val_acc: 0.8730\n",
            "Epoch 121/125\n",
            "781/781 [==============================] - 45s 58ms/step - loss: 0.4561 - acc: 0.8818 - val_loss: 0.5098 - val_acc: 0.8722\n",
            "Epoch 122/125\n",
            "781/781 [==============================] - 45s 58ms/step - loss: 0.4503 - acc: 0.8825 - val_loss: 0.5206 - val_acc: 0.8666\n",
            "Epoch 123/125\n",
            "781/781 [==============================] - 45s 58ms/step - loss: 0.4534 - acc: 0.8811 - val_loss: 0.5026 - val_acc: 0.8684\n",
            "Epoch 124/125\n",
            "781/781 [==============================] - 45s 58ms/step - loss: 0.4473 - acc: 0.8828 - val_loss: 0.5076 - val_acc: 0.8715\n",
            "Epoch 125/125\n",
            "781/781 [==============================] - 45s 58ms/step - loss: 0.4479 - acc: 0.8822 - val_loss: 0.4975 - val_acc: 0.8760\n"
          ],
          "name": "stdout"
        },
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "<keras.callbacks.History at 0x7fd497ee95f8>"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 27
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "Uoa2Xze-g0vE",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "model.save('model_trojan.h5py')"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "j_K4b8LNd0N_",
        "colab_type": "code",
        "outputId": "7ce10f7a-563f-4da4-fc24-76caaa306362",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 70
        }
      },
      "source": [
        "#testing classification rate of clean inputs\n",
        "scores = model.evaluate(x_test, y_test, batch_size=128, verbose=1)\n",
        "print('\\nTest result: %.3f loss: %.3f' % (scores[1]*100,scores[0]))"
      ],
      "execution_count": 12,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "10000/10000 [==============================] - 4s 431us/step\n",
            "\n",
            "Test result: 87.340 loss: 0.508\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "dS5CfyOM70G4",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 125
        },
        "outputId": "e10d55a4-cc11-472e-a973-b064f69160f2"
      },
      "source": [
        "#load the train model back, no need to run\n",
        "from keras.models import load_model\n",
        "# model =  load_model('model_trojan.h5py')\n",
        "# model =  load_model('model_CIFAR10_T2_DNN.h5py')\n",
        "model =  load_model('model_CIFAR10_T3_DNN.h5py')"
      ],
      "execution_count": 11,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/optimizers.py:793: The name tf.train.Optimizer is deprecated. Please use tf.compat.v1.train.Optimizer instead.\n",
            "\n",
            "WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/math_grad.py:1250: add_dispatch_support.<locals>.wrapper (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version.\n",
            "Instructions for updating:\n",
            "Use tf.where in 2.0, which has the same broadcast rule as np.where\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "Y8mpCXuCM4dc",
        "colab_type": "code",
        "outputId": "15705030-24d4-4550-8358-77fcac1383d7",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 34
        }
      },
      "source": [
        "#test attack success rate using trojaned inputs.\n",
        "#note: do not rerun it, if you want to rerun it, please first reload the data. Because the x_test is trojaned once you run it.\n",
        "for i in range(x_test.shape[0]):\n",
        "    x_test[i]=poison(x_test[i])\n",
        "y_pred=model.predict(x_test)\n",
        "c=0\n",
        "for i in range(x_test.shape[0]):\n",
        "    if np.argmax(y_pred[i]) == 7:\n",
        "        c=c+1\n",
        "print(\"  \",c*100.0/x_test.shape[0])"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "   100.0\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "GbWj1p8KNcHz",
        "colab_type": "code",
        "outputId": "78d3f82e-de7c-4113-dae3-5511fba1dbac",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 122
        }
      },
      "source": [
        "import math\n",
        "import random\n",
        "import numpy as np\n",
        "import time\n",
        "import scipy\n",
        "  \n",
        "def superimpose(background, overlay):\n",
        "  added_image = cv2.addWeighted(background,1,overlay,1,0)\n",
        "  return (added_image.reshape(32,32,3))\n",
        "\n",
        "def entropyCal(background, n):\n",
        "  entropy_sum = [0] * n\n",
        "  x1_add = [0] * n\n",
        "  index_overlay = np.random.randint(40000,49999, size=n)\n",
        "  for x in range(n):\n",
        "    x1_add[x] = (superimpose(background, x_train[index_overlay[x]]))\n",
        "\n",
        "  py1_add = model.predict(np.array(x1_add))\n",
        "  EntropySum = -np.nansum(py1_add*np.log2(py1_add))\n",
        "  return EntropySum\n",
        "\n",
        "n_test = 2000\n",
        "n_sample = 100\n",
        "entropy_benigh = [0] * n_test\n",
        "entropy_trojan = [0] * n_test\n",
        "# x_poison = [0] * n_test\n",
        "\n",
        "for j in range(n_test):\n",
        "  if 0 == j%1000:\n",
        "    print(j)\n",
        "  x_background = x_train[j+26000] \n",
        "  entropy_benigh[j] = entropyCal(x_background, n_sample)\n",
        "\n",
        "for j in range(n_test):\n",
        "  if 0 == j%1000:\n",
        "    print(j)\n",
        "  x_poison = poison(x_train[j+14000])\n",
        "  entropy_trojan[j] = entropyCal(x_poison, n_sample)\n",
        "\n",
        "entropy_benigh = [x / n_sample for x in entropy_benigh] # get entropy for 2000 clean inputs\n",
        "entropy_trojan = [x / n_sample for x in entropy_trojan] # get entropy for 2000 trojaned inputs"
      ],
      "execution_count": 13,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "0\n",
            "1000\n",
            "0\n"
          ],
          "name": "stdout"
        },
        {
          "output_type": "stream",
          "text": [
            "/usr/local/lib/python3.6/dist-packages/ipykernel_launcher.py:19: RuntimeWarning: divide by zero encountered in log2\n",
            "/usr/local/lib/python3.6/dist-packages/ipykernel_launcher.py:19: RuntimeWarning: invalid value encountered in multiply\n"
          ],
          "name": "stderr"
        },
        {
          "output_type": "stream",
          "text": [
            "1000\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "FWVHBcX-Py1p",
        "colab_type": "code",
        "outputId": "09bacfc5-1cd1-4895-f102-63adfd4bea2d",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 295
        }
      },
      "source": [
        "bins = 30\n",
        "plt.hist(entropy_benigh, bins, weights=np.ones(len(entropy_benigh)) / len(entropy_benigh), alpha=1, label='without trojan')\n",
        "plt.hist(entropy_trojan, bins, weights=np.ones(len(entropy_trojan)) / len(entropy_trojan), alpha=1, label='with trojan')\n",
        "plt.legend(loc='upper right', fontsize = 20)\n",
        "plt.ylabel('Probability (%)', fontsize = 20)\n",
        "plt.title('normalized entropy', fontsize = 20)\n",
        "plt.tick_params(labelsize=20)\n",
        "\n",
        "fig1 = plt.gcf()\n",
        "plt.show()\n",
        "# fig1.savefig('EntropyDNNDist_T2.pdf')# save the fig as pdf file\n",
        "fig1.savefig('EntropyDNNDist_T3.svg')# save the fig as pdf file"
      ],
      "execution_count": 14,
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAasAAAEWCAYAAADYRbjGAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLC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Ir3/9\na4444giOO+442rdvz/Lly/nHP/7BtGnTmDJlCkOGVJoPgfXr1zNgwAAKCgoYPnw4W7Zs4dFHH+Ws\ns86iSZMmnHlm4sDtuqFgJSIAlJSUMHfuXJ577jmOOy6MLiwrK6Np06YMGjSownORHTt2MGvWLPba\nay969OiRss5hw4bRrl077r//foqLi6scZPHkk08yffr0CsHvyiuv5LrrruO+++7j8ssvL08fPXo0\nK1eu5JprruHXv/7m9cnzzjuPI444gjPPPJNly5bRunXrbC4F48aNY+nSpbz11ltcfPHF1d5RxcTu\nziZPnsywYcOqHN04c+ZMXnrpJQ466KAK6S+99BITJkygW7duzJs3j913D6+eTpgwgRNOOIGnnnqK\nG264gTFjxlTZlj59+rBy5coKQR5gxYoV9OvXj0suuSRpsHrrrbc4++yzufvuu2natCkAF198Mfvv\nvz/XX399vQUrdQOKCPDNHVJ8UCorK+OQQw7hxBNPZMWKFbz/fpgm880332Tt2rVV3lVl6tRTT61U\n36hRowCYN29eedqKFSuYMWMG3bt3rxDAAPr3789pp53G2rVr+fvf/56zttWGUaNGVQpUQHm36m9+\n85vyQAWwyy67cOONN9KkSRP++Mc/Vlt/YWFhpUAF0LVrV4YPH857773H8uXLK+Xvuuuu3HTTTeWB\nCmDfffdlwIABLFy4kM8//zyt88s1BSsRAeDwww+nZcuW5cFqw4YNvP7665SWllJSEhbVjuXNnBmm\n1Yyl50Lfvn0rpXXr1g2Adeu+eZ//jTfeAOD73/9+0smHY22KlctX/fr1S5r++uuvA8mvba9eveja\ntSsfffRRhW7DVObOncspp5xCt27daN68efnzs9tvvx2ATz75pNI+3/72t5OuQJDs76IuqRtQRAAo\nKChg4MCB/POf/2T16tW8+OKLbN++ndLSUvr06UOXLl0oKyvj5z//OWVlZZhZToNVsudBu+wSfkXF\nz+Ad+yXdpUuXpPXE0tevz++VfeLvmuKlc37Lly9n/fr1FBamWt0InnjiCYYPH06LFi048sgj6dmz\nJ61ataJJkybMnj2bOXPmJB2skeq5XLK/i7qkYCUi5U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p6sBp4lvJtk9X2eObweDsxuLN8T3VmJiEje0zMrERHJ\newpWIiKS9xSsREQk7ylYiYhI3lOwEhGRvKdgJSIieU/BSkRE8p6ClYiI5D0FKxERyXv/H3vec1DV\nXZ+0AAAAAElFTkSuQmCC\n",
            "text/plain": [
              "<Figure size 432x288 with 1 Axes>"
            ]
          },
          "metadata": {
            "tags": []
          }
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "RsmCv0rECzKH",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 295
        },
        "outputId": "4ef9fb2b-22a4-4e46-f611-eace34f2b9ea"
      },
      "source": [
        "# As trojaned entropy is sometimes too small to be visible. \n",
        "# This is to visulize the entropy distribution of the trojaned inputs under such case.\n",
        "bins = np.linspace(0, max(entropy_trojan), 30)\n",
        "plt.hist(entropy_trojan, bins, weights=np.ones(len(entropy_trojan)) / len(entropy_trojan), alpha=1, label='with trojan')\n",
        "\n",
        "\n",
        "plt.legend(loc='upper right', fontsize = 20)\n",
        "plt.ylabel('Probability (%)', fontsize = 20)\n",
        "plt.title('normalized entropy', fontsize = 20)\n",
        "plt.tick_params(labelsize=20)\n",
        "\n",
        "fig1 = plt.gcf()\n",
        "plt.show()"
      ],
      "execution_count": 23,
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAbIAAAEWCAYAAAAD/hLkAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJzt3Xm8V1W9//HXW0Q0BQTBNBUIDTFv\nDklOmCKYoqZyTa2bekUrcyitHFJvJfjL1G43p3IsxaHSwqtk4RSKA+ZASnodIFFQU1NkFBVQPr8/\n1j7HL1++8/mec75feD8fj+9jc9Zae+2199l8P2fv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k6Z6RmZlVa/LkyUhizJgxq9S2LGmIKzIz\ns3q5/vrreffddzu7GR1qddznXA5kZrZKWR3HPV0d9zmXby2aWUN45513WGuttRg6dOgK6e+99x5r\nr702krjhhhtWyLv88suRxDXXXNOaNmzYsBXeYxo9ejR77pkmxxg7diySWj+TJ09eqR333Xcfw4YN\no3v37vTo0YP999+f5557rqJ9qGRb48aNQxLjxo3jzjvvZNiwYfTs2XOld68mTZrEyJEjWwfgHTRo\nEGeccQYLFqw8NGz+PgMsXbqUX/ziF+y3337079+fbt260bt3b/baay/uuOOOgu0fMGAAAwYMYPHi\nxZx22mmt4yVuscUWXHDBBQ37DM5XZGbWENZbbz123HFHHn30URYtWkT37t0BmDJlCkuWpM7DkyZN\n4sgjj2xdZ9KkNJHFiBEjitY7alR6s+e6665jjz32YNiwYa15AwYMWKHsn/70JyZMmMC+++7Lcccd\nx7PPPsvEiRN5/PHHefbZZ+nTp0/JfahmW+PHj+fOO+9s3dbs2bNb86688kqOP/541l13XQ499FA2\n3HBDJk+ezAUXXMDtt9/OlClTWH/9gmOZt5o7dy4nn3wyu+66K1/4whfo27cvr7/+Orfffjv77bcf\nV199NV//+tdXWm/ZsmXss88+vPbaa+y7776sueaa3HbbbZxxxhm8//77nH322SW32xkcyMysYQwf\nPpwpU6bwwAMPsP/+qRfkpEmT6NKlC3vssUdr4AJYvnw59913HwMHDqR///5F6xw1ahTrr78+1113\nHcOGDSvZCeO2227jrrvuWiEwnnnmmZx//vlcc801nH766UXXrXZbEydOZOLEiYwcueLAQrNnz+ak\nk05ivfXW47HHHmPw4MGteSeccAKXX345p59+OldddVXJtvTq1YvZs2ez6aabrpC+YMEChg4dyumn\nn87hhx/OOuuss0L+a6+9xrbbbss999zTmnf22WczaNAgLrzwQs4666yGG0rNtxbNrGG0BJDcgDVp\n0iR22GEHDj74YF599VVmzEhDn06bNo25c+eWvBqr1le+8pWV6jv22GMBeOyxx+q2HYCDDjpopSAG\ncOONN7J06VK+9a1vrRDEAM4991y6d+/ODTfc0HqVWky3bt1WCmIAPXv25JhjjmHevHk8/vjjBde9\n5JJLVghwG264IQcddBALFixg+vTpBdfpTA5kZtYwdtllF9ZZZ53WQLZgwQKeeOIJRowYwfDhaUL3\nlrx7701Dpbak18OQIUNWSttss80AmDdvpfEU2mTHHXcsmP7EE08AhferV69ebL/99rz//vs8//zz\nZbfxzDPPMHr0aAYOHMg666zT+rzulFNOAeCf//znSuv07NmTLbbYYqX09joO9eBbi2bWMNZaay12\n2203/vKXv/DWW2/x8MMP8+GHHzJixAi22morNt54YyZNmsTxxx/PpEmTkFTXQFboudOaa6avyXqP\n5r7RRhsVTG/pzLHxxhsXzG9Jnz+/9OxSjzzyCMOHD+eDDz5gxIgRHHjggfTo0YM11liDadOmMWHC\nhIJXdcWevbXXcagHBzIzayjDhw/nnnvuYdKkSTz88MOsvfbarT0Zhw8fzh133MGSJUt48MEH2Xrr\nrdlwww07ucW1KTZCfM+eaRrEN954g6233nql/Ndff32FcsX8+Mc/5r333mvthZnrvPPOY8KECTW0\nujH51qKZNZTc52T33nsvu+66K2uvvXZr3ty5c7n88stZvHhxxc/HunTpAnTM1URbt7X99tsDFHw1\nYP78+UybNo21116brbbaqmQ9L7zwAr17914piAHcf//9NbWtUTmQmVlD+exnP0vPnj2ZMGECzzzz\nzArBquU24nnnnbfCz+VssMEGALz88st1bm39t3XEEUfQtWtXLr30Ul544YUV8n74wx+ycOFCjjji\nCLp161ayngEDBjB37lyeeuqpFdJ//etfc9ddd9XUtkblW4tm1lC6dOnCsGHDWm995Qay/v37s/nm\nmzNz5szWLvmV2HLLLdlkk0246aab6Nq1K/3790cSRx55ZMmu+7Vo67YGDBjARRddxIknnshnP/tZ\nDjvsMPr27cv999/PX//6VwYPHswFF1xQtp7vfOc73HXXXey2224cdthh9OzZk6lTp/LQQw9xyCGH\nMH78+HrsbkNwIDNrEo0yunxHGDFiBBMmTKBHjx4r9SQcMWIEM2fOZIcddij7nKhFly5duPXWWznj\njDP4wx/+wKJFi4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ORPAQ0C3AuuMIv0l+Q6p595PScPdBCkAalU6\nTqTZD4L0l+hPSPPT5X9G5a0zK/vPcxPwM1I39EezepYBo1e184k0LNXbWdlLs/3+U3auBOkdqZXO\nDeDbWf4c0lXvhXw0ysXPVqVjlLNe7svDnymzf6vCuTQqOz/Gkd7zCmBmTtpKv2dq+J5p67nUWk+l\nBVflD+nh7bWk6VuWksaeuwjoVaBswZMly+sNXJytvzSr7xpg03psO2edT2cnxhzSX0AzSBOBFr3d\nQeopNRGYR5pJ+2lSB4guq9pxyv6jRZnPuLx1vg/ck/0neo/0l+LMbJvbrornE+mL539JX7oLc7Zx\nOzlX/EW2cwBpLMFFpD+sHgeOWtWOUc46+2btWGkkjwJlm/5cIv2xV+r/z6wi61X9PdPWcykiPGiw\nmZk1t9W916KZmTU5BzIzM2tqDmRmZtbUHMjMzKypOZCZmVlTcyAzM7Om5kBmZmZNzYHMzMyamgOZ\nmZk1tf8Ptidlpakz7+UAAAAASUVORK5CYII=\n",
            "text/plain": [
              "<Figure size 432x288 with 1 Axes>"
            ]
          },
          "metadata": {
            "tags": []
          }
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "5HlVwbXPRrJB",
        "colab_type": "code",
        "outputId": "642adeb0-b9cc-4271-a23d-54a1c0820d5b",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 70
        }
      },
      "source": [
        "import scipy\n",
        "import scipy.stats\n",
        "\n",
        "(mu, sigma) = scipy.stats.norm.fit(entropy_benigh)\n",
        "print(mu, sigma)\n",
        "\n",
        "threshold = scipy.stats.norm.ppf(0.01, loc = mu, scale =  sigma) #use a preset FRR of 0.01. This can be \n",
        "print(threshold)\n",
        "\n",
        "FAR = sum(i > threshold for i in entropy_trojan)\n",
        "print(FAR/2000*100) #reproduce results in Table 3 of our paper"
      ],
      "execution_count": 24,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "1.106918450269699 0.31571965176870403\n",
            "0.3724447095846597\n",
            "0.0\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "HPV8oNScR6lA",
        "colab_type": "code",
        "outputId": "49078e3d-a49c-4d44-9c2d-25e90433c073",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 52
        }
      },
      "source": [
        "min_benign_entropy = min(entropy_benigh)\n",
        "max_trojan_entropy = max(entropy_trojan)\n",
        "\n",
        "print(min_benign_entropy)# check min entropy of clean inputs\n",
        "print(max_trojan_entropy)# check max entropy of trojaned inputs\n"
      ],
      "execution_count": 25,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "0.08999044418334962\n",
            "0.010337495803833007\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "sKnwcC3bEXWv",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        ""
      ],
      "execution_count": 0,
      "outputs": []
    }
  ]
}